Data processing method and device

By acquiring and processing historical data carrying protocol information, using target protocol items and historical protocol item description information to process historical data, the problem of excessive storage resource occupation caused by storing historical version data protocols in the prior art is solved, and more efficient storage utilization is achieved.

CN114510463BActive Publication Date: 2025-05-13ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210142969.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2025-05-13
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

In the process of business data, the prior art requires each data protocol to store its historical version to ensure compatibility, resulting in excessive storage resource utilization.

Method used

By obtaining historical data carrying protocol information, the target protocol item description information and historical protocol item description information are determined, and the historical sub-data in the historical data are processed based on this information to generate target data, avoiding the storage of historical version data protocols.

Benefits of technology

It realizes processing of historical data through protocol item description information, reducing the storage space of the historical data protocol and avoiding storing multiple historical versions of the data protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114510463B_ABST
    Figure CN114510463B_ABST
Patent Text Reader

Abstract

The present application provides a data processing method and device, wherein the data processing method comprises: obtaining historical data carrying protocol information; determining target protocol item description information and historical protocol item description information corresponding to the protocol information; processing historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain target data. The historical data is processed through the protocol item description information, avoiding the processing of the historical data through the data protocol of the historical version.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method and apparatus, a computing device, and a computer-readable storage medium. Background Art

[0002] In actual applications, when business data is processed, it is usually required that the business data meet the agreed data protocol. If the business data is different from the agreed data protocol, the business data cannot be processed. In the process of updating and iterating the business program, the data protocol may be updated multiple times. Therefore, historical business data may not match the latest data protocol. When performing business backtracking on historical business data, it is necessary to process it first through the historical version of the data protocol corresponding to the historical business data. At present, the corresponding historical version of the data protocol is stored for each data protocol to ensure compatibility with historical data. In this way, when there are many data protocols and they may be updated multiple times, a large amount of storage resources will be occupied. Therefore, it is urgent to provide a technical solution to the above problems. Summary of the invention

[0003] In view of this, the embodiments of the present application provide a data processing method and apparatus, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of the present application, a data processing method is provided, including:

[0005] Obtain historical data carrying protocol information;

[0006] Determine the target protocol item description information and the historical protocol item description information corresponding to the protocol information;

[0007] The historical sub-data in the historical data are processed according to the target protocol item description information and the historical protocol item description information to obtain the target data.

[0008] Optionally, before acquiring the historical data carrying the protocol information, the method further includes:

[0009] Receiving initial data carrying the protocol information;

[0010] Determine initial protocol item description information and second historical protocol item description information corresponding to the protocol information;

[0011] The initial sub-data in the initial data is converted according to the initial protocol item description information and the second historical protocol item description information to obtain and store the historical data.

[0012] Optionally, the processing the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain the target data includes:

[0013] Determine the information arrangement order according to the target protocol item sequence number in the target protocol item description information and the historical protocol item sequence number in the historical protocol item description information;

[0014] The first protocol item description information in the target protocol item description information and the second protocol item description information in the historical protocol item description information are sequentially processed on the historical sub-data in the historical data according to the information arrangement order to obtain the target data.

[0015] Optionally, the historical sub-data in the historical data is processed by using the first protocol item description information, which is specifically implemented in the following manner:

[0016] In the case that any descriptive sub-information in the first protocol item description information does not have corresponding historical sub-data in the historical data, taking the any descriptive sub-information that does not have corresponding historical sub-data in the historical data as the first descriptive sub-information, and creating target sub-data according to the first descriptive sub-information;

[0017] In the case that any descriptive sub-information in the first protocol item description information has corresponding first historical sub-data in the historical data, any descriptive sub-information that has corresponding first historical sub-data in the historical data is used as second descriptive sub-information, and the first historical sub-data is processed according to the second descriptive sub-information to obtain target sub-data.

[0018] Optionally, the processing the first historical sub-data according to the second descriptor information to obtain target sub-data includes:

[0019] Determine a target data type corresponding to the first data type of the first historical sub-data in the second descriptor information;

[0020] Determine a target variable name corresponding to the target data type in the second descriptor information;

[0021] Using the data value corresponding to the first data type as the target data value corresponding to the target variable name;

[0022] The target sub-data is generated according to the target data type, the target variable name and the target data value.

[0023] Optionally, the step of determining that the target data type is after the target variable name corresponding to the second descriptor information includes:

[0024] Determine the target data quantity corresponding to the target variable name in the second descriptor information;

[0025] determining a target data value of the target data quantity based on a data value of a first data quantity corresponding to the first data type;

[0026] The target sub-data is generated according to the target data type, the target variable name, the target data quantity and the target data value.

[0027] Optionally, creating target sub-data according to the first descriptor information includes:

[0028] Determine the target data type in the first descriptor information and determine the target variable name and preset value corresponding to the target data type, and use the preset value as the target data value;

[0029] The target sub-data is generated according to the target data type, the target variable name and the target data value.

[0030] Optionally, the historical sub-data in the historical data is processed by using the second protocol item description information, which is specifically implemented in the following manner:

[0031] In the case where the second protocol item description information has corresponding second historical sub-data in the historical data, the second historical sub-data is deleted from the historical sub-data.

[0032] Optionally, performing data conversion on initial sub-data in the initial data according to the initial protocol item description information and the second historical protocol item description information to obtain and store the historical data includes:

[0033] Determining the arrangement order of the second information according to the initial protocol item sequence number in the initial protocol item description information and the second historical protocol item sequence number in the second historical protocol item description information;

[0034] The third protocol item description information in the initial protocol item description information and the fourth protocol item description information in the second historical protocol item description information are sequentially converted into the initial sub-data in the initial data according to the arrangement order of the second information to obtain and store the historical data.

[0035] According to a second aspect of an embodiment of the present application, there is provided a data processing device, including:

[0036] An acquisition module, configured to acquire historical data carrying protocol information;

[0037] A determination module, configured to determine target protocol item description information and historical protocol item description information corresponding to the protocol information;

[0038] The processing module is configured to process the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain the target data.

[0039] According to a third aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the data processing method when executing the computer instructions.

[0040] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions implement the steps of the data processing method when executed by a processor.

[0041] In the embodiment of the present application, by acquiring historical data carrying protocol information; determining the target protocol item description information and the historical protocol item description information corresponding to the protocol information; and processing the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information, the target data is obtained, thereby realizing the processing of historical data through the description information of the protocol item and avoiding the processing of historical data through the data protocol of the historical version. Therefore, there is no need to store the data protocol of the historical version, thereby reducing the storage space occupied by the historical data protocol. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 is a structural block diagram of a computing device provided by an embodiment of the present application;

[0043] Figure 2 is a flow chart of a data processing method provided by an embodiment of the present application;

[0044] Figure 3 It is a processing flow chart of a data processing method applied in an actual scenario provided by an embodiment of the present application;

[0045] Figure 4 It is a structural diagram of a data processing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0046] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0047] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0048] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0049] In the present application, a data processing method and apparatus, a computing device, and a computer-readable storage medium are provided, which are described in detail one by one in the following embodiments.

[0050] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present application is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.

[0051] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0052] In one embodiment of the present application, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0053] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.

[0054] The processor 120 may execute Figure 2 The steps in the data processing method shown. Figure 2 A flow chart of a data processing method according to an embodiment of the present application is shown, which specifically includes the following steps:

[0055] Step 202: Acquire historical data carrying protocol information.

[0056] Specifically, protocol information refers to information such as the type of data protocol or the protocol number that can distinguish different types of data protocols. Among them, the data protocol can be understood as a pre-agreed protocol of the data structure required for operations such as transmission, verification, and use of data. Specifically, the protocol can stipulate structural information such as the data type, data name, and number of data items. Usually different types of data correspond to different types of data protocols, such as the login protocol corresponding to login data. Fighting data corresponds to fighting protocols.

[0057] Assume that the data protocol XXX can be StructXXX{IntnID; IntnValue; BYTEbyData;}, where XXX is the protocol name, and IntnID, IntnValue, BYTEbyDdata are protocol items contained in the data structure agreed upon by the protocol XXX.

[0058] Accordingly, historical data can be understood as historical protocol data, and the protocol data carries protocol information, indicating that it is data associated with the data protocol corresponding to the protocol information.

[0059] In specific implementation, there are various ways to obtain historical data carrying protocol information. For example, when receiving a data processing instruction submitted by a user, historical data carrying protocol information can be obtained according to the data identification information carried in the data processing instruction. In addition, historical data carrying protocol information uploaded by a user can also be received, which is not limited here.

[0060] Step 204: Determine the target protocol item description information and the historical protocol item description information corresponding to the protocol information.

[0061] Specifically, based on the above acquisition of historical data carrying protocol information, if the data protocol corresponding to the historical data has been updated, in order to avoid storing the historical version of the data protocol, the present application can describe the historical version of the data protocol and the current data protocol through the description information of the target protocol item (i.e., the target protocol item description information) and the description information of the historical protocol item (i.e., the historical protocol item description information), and then restore the target protocol item and the historical protocol item.

[0062] Among them, the target protocol item can be understood as the protocol item included in the current data protocol corresponding to the protocol information. The protocol item can be understood as a pre-agreed protocol for constraining data. Correspondingly, the historical protocol item can be understood as the protocol item other than the target protocol item included in the historical data protocol corresponding to the protocol information. The historical data protocol includes historical versions of data protocols in history other than the current data protocol. Therefore, through the target protocol item description information and the historical protocol item description information, the restoration including the target protocol item and the historical protocol item can be realized. Therefore, based on these two description information, the processing of historical data can be realized without the historical version of the data protocol.

[0063] In actual applications, in order to ensure interoperability between different versions of protocols, the protocol information will not change during the update process of the data protocol. Therefore, the correspondence between the protocol information and the above-mentioned target protocol item description information and the historical protocol item description information can be established in advance, and the description information corresponding to the protocol information can be determined through the protocol information and the correspondence. In addition, the target protocol item description information and the historical protocol item description information can also be directly identified through the protocol information. In this case, these description information can be directly found through the protocol information.

[0064] In specific implementation, since the historical version of the data protocol and the current data protocol can be described by the target protocol item description information and the historical protocol item description information, there is no need to store the historical version of the data protocol. Only the current data protocol and the two description information need to be stored, thus avoiding the need to maintain and store multiple versions of the data protocol.

[0065] Step 206: Process the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain target data.

[0066] Specifically, based on the target protocol item description information and the historical protocol item description information corresponding to the determined protocol information, the historical sub-data in the historical data can be processed through these description information.

[0067] In practical applications, historical sub-data can be understood as protocol data items in historical data. That is, one historical sub-data corresponds to one protocol item. Furthermore, processing historical sub-data in historical data can be understood as converting historical data into target data that conforms to the current data protocol by processing the historical sub-data.

[0068] In a specific implementation, the historical sub-data in the historical data is processed according to the target protocol item description information and the historical protocol item description information to obtain the target data, which is specifically implemented in the following manner:

[0069] Determine the information arrangement order according to the target protocol item sequence number in the target protocol item description information and the historical protocol item sequence number in the historical protocol item description information;

[0070] The first protocol item description information in the target protocol item description information and the second protocol item description information in the historical protocol item description information are sequentially processed on the historical sub-data in the historical data according to the information arrangement order to obtain the target data.

[0071] Among them, the target protocol item sequence number refers to the sequence number corresponding to the description information of the target protocol item. Usually, the target protocol description information may contain description information of multiple target protocol items. Among them, the description information of each target protocol item has a corresponding sequence number. The target protocol item sequence number also indicates the identification sequence number of the corresponding target protocol item in the protocol item (including the current protocol item and the historical protocol item). Correspondingly, the historical protocol item sequence number refers to the sequence number corresponding to the description information of the historical protocol item. Similarly, the historical protocol description information may contain description information of multiple historical protocol items. Among them, the description information of each historical protocol item has a corresponding sequence number. The historical protocol item sequence number also indicates the identification sequence number of the historical protocol item in the protocol item (including the current protocol item and the historical protocol item). Therefore, according to the sequence number size of the target protocol item sequence number in the target protocol item description information and the historical protocol item sequence number in the historical protocol item description information, not only the information arrangement order corresponding to these description information can be determined, but also the identification order between these target protocol items and the historical protocol items can be determined.

[0072] In specific implementation, since the protocol items may be added, deleted or changed during the data protocol update process, in order to ensure that the identification number corresponding to the protocol item is not changed during the data protocol update process, the original identification number can be maintained when the protocol item is deleted or changed. When the protocol item is added, the added protocol item is given an identification number that exceeds the maximum identification number in the original identification numbers.

[0073] It should be noted that, in order to facilitate the management and maintenance of the target protocol item description information and the historical protocol item description information, these description information can be recorded in a protocol description table, and these description information can be arranged in the protocol description table according to their sequence numbers.

[0074] For example, the protocol description table XXX can be expressed as: "XXX": {

[0075] "1": {"type": "int64_t", "name": "11ID", "count": 1, "Empty": 0},

[0076] "2": {"type": "int32_t", "name": "nValue", "count": 1, "Empty": 1},

[0077] "3": {"type": "uint8_t", "name": "byData", "count": 2, "Empty": 0},

[0078] }

[0079] Among them, "1", "2", and "3" are serial numbers (i.e., the target protocol item serial number or the historical protocol item serial number). The information corresponding to each serial number represents a protocol item description sub-information (i.e., the target protocol item description information or the historical protocol item description information). The information in the curly brackets corresponding to the serial number is the description sub-information (the description sub-information in the first protocol item description information and the second protocol item description information). Among them, in each description sub-information, the value of type represents the data type of the protocol item; the value of name represents the variable name; the value of count represents the number of variables; the value of Empty is 0, indicating that the protocol item corresponding to the description sub-information exists in the current data protocol; the value of Empty is 1, indicating that the protocol item corresponding to the description sub-information does not exist in the current data protocol. Therefore, the entire data corresponding to "Empty": 0 belongs to the target protocol item description information, and the description sub-information in the curly brackets belongs to the first protocol item description information. The entire data corresponding to "Empty": 1 belongs to the historical protocol item description information, and the description sub-information in the curly brackets belongs to the second protocol item description information.

[0080] Based on this, the first protocol item description information in the target protocol item description information and the second protocol item description information in the historical protocol item description information are processed in sequence according to the information arrangement order on the historical sub-data in the historical data to obtain the target data. The first protocol item description information refers to the description information in the target protocol item description information except the target protocol item sequence number. The second protocol item description information refers to the description information in the historical protocol item description information except the historical protocol item sequence number.

[0081] In a specific implementation, the historical sub-data in the historical data is processed by using the first protocol item description information, which is specifically implemented by executing the following steps 2062 to 2064:

[0082] Step 2062: In the event that any descriptive sub-information in the first protocol item description information does not have corresponding historical sub-data in the historical data, any descriptive sub-information that does not have corresponding historical sub-data in the historical data is used as the first descriptive sub-information, and the target sub-data is created based on the first descriptive sub-information.

[0083] Specifically, since the first protocol item description information may include multiple descriptor information, if any descriptor information does not have corresponding historical sub-data in the historical data, it is necessary to create corresponding target sub-data according to the descriptor information.

[0084] Because any descriptor information does not have corresponding historical sub-data in the historical data, it indicates that the target protocol item has been increased compared to the protocol item corresponding to the historical sub-data. In this case, in order to make the target data conform to the data structure of the current data protocol, it is necessary to use any descriptor information as the first descriptor information and create target sub-data that satisfies the target protocol item corresponding to the first descriptor information.

[0085] In a specific implementation, the target sub-data is created according to the first descriptor information, which is specifically implemented in the following manner:

[0086] Determine the target data type in the first descriptor information and determine the target variable name and preset value corresponding to the target data type, and use the preset value as the target data value;

[0087] The target sub-data is generated according to the target data type, the target variable name and the target data value.

[0088] Specifically, the target data type refers to the data type included in the first descriptor information.

[0089] The preset value can be understood as a default value pre-set for the target data type. For example, when the target data type is a numeric type, the preset value can be set to 0; when the target data type is a Boolean data type, the preset value can be set to no. In addition, since the numerical value does not actually exist in the historical data, even if a value is assigned to it, the preset value is usually set to a data value that has no practical meaning to avoid unexpected business effects.

[0090] Furthermore, the target data type, target variable name and target data value are combined to generate the target sub-data corresponding to the first protocol item description information. In specific implementation, a rule for combining the target quantity type, target variable name and preset value, i.e., a preset combination rule, can also be preset. The three data are then combined according to the preset combination rule.

[0091] Assume that the descriptor information in the first protocol item description information in the protocol description table XXX: {"type":"int64_t","name":"nNum","count":1} does not have corresponding historical sub-data in the historical data, then the descriptor information is used as the first descriptor information. And determine that the target data type in the first descriptor information is: int64_t; determine that the target variable name corresponding to the target data type is nNum. In addition, determine that the preset value corresponding to the target data type is 0. Then combine the target quantity type, target variable name and preset value according to the preset combination rule, and the generated target sub-data is nNum=(int64_t)0.

[0092] It should be noted that, in order to facilitate identification of the data protocol to which the historical sub-data belongs, the data protocol to which the historical sub-data belongs is usually identified in the historical data. Therefore, when creating the target sub-data, in order to clarify the data protocol to which each target sub-data belongs, the protocol name of the data protocol can be added before each target sub-data. For example, after adding the protocol name XXX to the above target sub-data, the target sub-data is updated to: XXX.nNum = (int64_t) 0.

[0093] In summary, when the historical sub-data corresponding to any descriptor information is missing in the historical data, the target sub-data is directly created based on the descriptor information, and the target sub-data is used as part of the target data, ensuring that the data structure of the target data can meet the data structure defined in the current data protocol.

[0094] Step 2064: In the case that any descriptive sub-information in the first protocol item description information has corresponding first historical sub-data in the historical data, any descriptive sub-information that has corresponding first historical sub-data in the historical data is used as second descriptive sub-information, and the first historical sub-data is processed according to the second descriptive sub-information to obtain the target sub-data.

[0095] Specifically, if any descriptor information has a corresponding first historical sub-data in the historical data, it indicates that the target protocol item has corresponding protocol data in the historical sub-data. Since the protocol item corresponding to the target protocol item and the first historical sub-data may change or be expressed in different forms, in this case, in order to make the target data conform to the data structure of the current data protocol, it is necessary to use any descriptor information as the second descriptor information, and process the first historical sub-data according to the second descriptor information to obtain the target sub-data that conforms to the target protocol item.

[0096] In a specific implementation, the first historical sub-data is processed according to the second descriptor information to obtain the target sub-data, which is specifically implemented in the following manner:

[0097] Determine a target data type corresponding to the first data type of the first historical sub-data in the second descriptor information;

[0098] Determine a target variable name corresponding to the target data type in the second descriptor information;

[0099] Using the data value corresponding to the first data type as the target data value corresponding to the target variable name;

[0100] The target sub-data is generated according to the target data type, the target variable name and the target data value.

[0101] During specific implementation, it is considered that the target protocol item and the protocol item corresponding to the first historical sub-data may change or be expressed in different forms. In order to rewrite the first historical sub-data according to the second descriptor information. During specific implementation, it is necessary to update the data type (first data type) of the first historical sub-data to the target data type in the second descriptor information. And it is necessary to update the variable name (i.e., the first variable name) of the first historical sub-data to the variable name (i.e., the target variable name) corresponding to the target data type in the second descriptor information. Considering that the composition method of the target sub-data and the composition method of the first historical sub-data may be different. Therefore, the target data type of the first data type in the first historical sub-data in the second descriptor information and the target variable name corresponding to the target data type can be directly determined.

[0102] The data value in the first historical sub-data is retained as the target data value, which is combined with the target data type and the target variable name to generate the target sub-data.

[0103] Assume that the descriptor information in the first protocol item description information in the protocol description table XXX: {"type":"int64_t","name":"11ID","Empty":0} has a corresponding first historical sub-data in the historical data, then the descriptor information is used as the second descriptor information. Specifically, the first historical sub-data is int32_t, 1 (where int32_t is the first data type of the first historical data, and 1 is the data value corresponding to the first data type), and the target data type corresponding to the first data type in the first historical sub-data in the second descriptor data is: int64_t, and the target variable name corresponding to the target data type is: 11ID. The data value 1 corresponding to the first data type is used as the target data value corresponding to the target variable name, and finally the target data type: int64_t, the target variable name: 11ID, and the target data value 1 are combined according to the rule of target variable name = (target data type) target data value to generate the target sub-data: 11ID = (int64_t) 1.

[0104] In addition, in order to clarify the data protocol to which each target sub-data belongs, the protocol name of the data protocol may be added before the target sub-data. After adding the protocol name, the target sub-data is updated to: XXX.11ID=(int64_t)1.

[0105] In summary, when there is a first historical sub-data corresponding to any descriptor information in the historical data, the first historical sub-data information is rewritten according to the descriptor information (second descriptor information) to obtain the target sub-data, so that the target sub-data can satisfy the protocol item corresponding to the second descriptor information. In addition, taking the target sub-data as part of the target data ensures that the data structure of the target data can satisfy the data structure defined in the current data protocol.

[0106] In addition, since the data protocol can also agree on the data quantity corresponding to each protocol item. And the data quantity may also change during the change of the data protocol. Therefore, after processing the historical data, it is also necessary to ensure that the data quantity of each sub-data in the processed target data is the same as the target data quantity agreed in the target protocol item. The embodiment of the present application is specifically implemented in the following manner:

[0107] Determine the target data quantity corresponding to the target variable name in the second descriptor information;

[0108] determining a target data value of the target data quantity based on a data value of a first data quantity corresponding to the first data type;

[0109] The target sub-data is generated according to the target data type, the target variable name, the target data quantity and the target data value.

[0110] In practical applications, in order to ensure that the data quantity in the generated target sub-data is the same as the data quantity agreed in the corresponding protocol item in the current data protocol, the data quantity of the variable name in the second descriptor information can be directly used as the target data quantity of the target sub-data. The target sub-data is created according to the target data quantity of the target variable name in the second descriptor information.

[0111] In specific implementation, if the target data quantity is greater than the first data quantity corresponding to the first data type in the first historical sub-data, the data value of the first data quantity in the first historical sub-data cannot satisfy the target data value of the target data quantity. Therefore, the data value of the first data quantity can be sequentially assigned to the target data value of the first data quantity before the target data quantity. For other target data values ​​that have not been assigned, they can be assigned according to the default data value corresponding to the target data type.

[0112] For example, the first historical data is uint8_t, 1, 3, where unit8_t is the first data type, 1 is the first data quantity, and 3 is the data value of the first data quantity. The corresponding second descriptor information is: {"type":"uint8_t","name":"byData","count":"2"}. The target data type corresponding to the first data type in the first historical sub-data in the second descriptor data is: uint8_t, and the target variable name corresponding to the target data type is: byData. The target data quantity corresponding to the target variable name is 2. Then the 1 data value 3 in the first historical data cannot satisfy the assignment of 2 target data quantities. Assign 3 to the first value corresponding to the target variable name byData. And assign the default value 0 corresponding to the target data type uint_8_t to the second value corresponding to the target variable name byData. Finally, the target data type: uint8_t, target variable name: byData, target data quantity 2, and target data values ​​3 and 0 are combined according to the rule of target variable name [the i-th data quantity in the target data quantity] = (target data type) target data value to generate the target sub-data: byData[0] = 3, and byData[0] = 0.

[0113] If the target data quantity is less than the first data quantity, the data values ​​corresponding to the first data quantity that are greater than the target data quantity need to be deleted. If the target data quantity is equal to the first data quantity, the data values ​​of the first data quantity can be used as the target data values ​​corresponding to the target data quantity.

[0114] In summary, when there is description information of the data quantity in the first protocol item description information, the target data value of the target data quantity is determined according to the data value of the first data quantity in the first historical sub-data. Further, the target sub-data is generated according to the target data type, the target variable name, the target data quantity and the target data value, so that the target sub-data can satisfy the protocol item corresponding to the second description sub-information. In addition, the target sub-data is used as part of the target data, which ensures that the data structure of the target data can satisfy the data structure defined in the current data protocol.

[0115] In addition, in addition to processing the historical sub-data in the historical data through the first protocol item description information, the historical sub-data in the historical data may also be processed through the second protocol item description information, which is specifically implemented in the following manner:

[0116] In the case where the second protocol item description information has corresponding second historical sub-data in the historical data, the second historical sub-data is deleted from the historical sub-data.

[0117] Specifically, the second protocol item description information has corresponding second historical sub-data in the historical data, indicating that the historical protocol item has corresponding protocol data in the historical sub-data. It also indicates that the protocol data, i.e., the protocol item corresponding to the second historical sub-data, no longer exists in the current data protocol. In this case, in order to make the target data conform to the data structure of the current data protocol, the second historical sub-data needs to be deleted from the historical sub-data.

[0118] For example, if the second protocol description information corresponding to the serial number 2 in the protocol description table XXX corresponds to the second historical sub-data in the historical data which is int32_t, 2, then the second historical sub-data is deleted from the historical sub-data of the historical data.

[0119] In summary, the data in the historical data that does not correspond to the protocol item of the current data protocol (ie, the second historical sub-data) is deleted, thereby ensuring that the data structure of the target data can satisfy the data structure defined in the current data protocol.

[0120] In practical applications, in addition to directly processing the data according to the current data protocol when receiving the data, it is considered that the data may need to be retroactively processed in the future. When the data is processed in the future, the corresponding data protocol may have been updated. Therefore, it is necessary to store the data when it is received. In the embodiment of the present application, before obtaining the historical data carrying the protocol information, it also includes:

[0121] Receiving initial data carrying the protocol information;

[0122] Determine initial protocol item description information and second historical protocol item description information corresponding to the protocol information;

[0123] The initial sub-data in the initial data is converted according to the initial protocol item description information and the second historical protocol item description information to obtain and store the historical data.

[0124] The initial data may be understood as data before the historical data is converted. In practical applications, when the initial data is received, it is usually necessary to convert and store the initial data so that the stored historical data can be directly processed later.

[0125] The initial protocol description information refers to the description information of the protocol item (i.e., the initial protocol item) in the data protocol (i.e., the initial data protocol) corresponding to the protocol information carried by the initial data when the initial data is received. Correspondingly, the second historical protocol item description information refers to the description information of the protocol items other than the initial protocol item in the historical data protocol before the initial data protocol when the initial data is received. The initial sub-data can be understood as the protocol data item in the initial data. That is, one initial sub-data corresponds to one protocol item.

[0126] In specific implementation, the specific implementation of data conversion of the initial sub-data in the initial data according to the initial protocol item description information and the second historical protocol item description information is similar to the specific implementation of the above step 206. Please refer to the specific implementation of the above step 206 and will not be repeated here.

[0127] In addition, considering that the data conversion is performed on the initial data when it is received, the initial data contains only the protocol data corresponding to the initial protocol item, and does not contain the protocol data of other protocols. Therefore, it can be converted into historical data through the initial protocol description information.

[0128] In summary, after receiving the initial data, the initial data is converted into historical data and stored according to the protocol item description information corresponding to the initial data, thereby realizing the conversion of the initial data into historical data that complies with the initial data protocol.

[0129] Furthermore, the performing of data conversion on the initial sub-data in the initial data according to the initial protocol item description information and the second historical protocol item description information to obtain and store the historical data is specifically implemented in the following manner:

[0130] Determining the arrangement order of the second information according to the initial protocol item sequence number in the initial protocol item description information and the second historical protocol item sequence number in the second historical protocol item description information;

[0131] The third protocol item description information in the initial protocol item description information and the fourth protocol item description information in the second historical protocol item description information are sequentially converted into the initial sub-data in the initial data according to the arrangement order of the second information to obtain and store the historical data.

[0132] Among them, the initial protocol item sequence number refers to the sequence number corresponding to the description information of the initial protocol item. Usually, the initial protocol description information may contain description information of multiple initial protocol items. Among them, the description information of each initial protocol item has a corresponding sequence number. The initial protocol item sequence number also indicates the identification sequence number of the corresponding initial protocol item in the protocol item (including the initial protocol item and the second historical protocol item) when receiving the initial data. Correspondingly, the second historical protocol item sequence number refers to the sequence number corresponding to the description information of the second historical protocol item. Similarly, the second historical protocol description information may contain description information of multiple second historical protocol items. Among them, the description information of each second historical protocol item has a corresponding sequence number. The second historical protocol item sequence number also indicates the identification sequence number of the second historical protocol item in the protocol item (including the initial protocol item and the second historical protocol item) when receiving the initial data. Therefore, according to the sequence number size of the initial protocol item sequence number in the initial protocol item description information and the second historical protocol item sequence number in the second historical protocol item description information, not only the information arrangement order corresponding to these description information can be determined, but also the identification order between these target protocol items and historical protocol items can be determined.

[0133] Based on this, the third protocol item description information in the initial protocol item description information and the fourth protocol item description information in the second historical protocol item description information are sequentially converted to the initial sub-data in the initial data according to the arrangement order of the second information, so as to obtain the historical data. Among them, the third protocol item description information refers to the description information in the initial protocol item description information except the initial protocol item sequence number. The fourth protocol item description information refers to the description information in the second historical protocol item description information except the second historical protocol item sequence number.

[0134] In specific implementation, the specific implementation of data conversion on the initial sub-data in the initial data is similar to the specific implementation of processing the historical sub-data in the historical data mentioned above. You can refer to the specific implementation of processing the historical sub-data in the historical data mentioned above, and no limitation is made here.

[0135] It should be noted that the display form of the historical data formed after the initial sub-data is converted may be different from the display form of the target data obtained by processing the historical data. In specific implementation, it can be set according to actual needs and is not limited here.

[0136] The data processing method provided in the embodiment of the present application obtains historical data carrying protocol information; determines the target protocol item description information and the historical protocol item description information corresponding to the protocol information; processes the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain the target data, thereby realizing the processing of historical data through the protocol item description information and avoiding the processing of historical data through the historical version of the data protocol. Therefore, there is no need to store the historical version of the data protocol, thereby reducing the storage space occupied by the historical data protocol.

[0137] The following combination Figure 3 , taking the application of the data processing method provided by this application in an actual scenario as an example, the data processing method is further explained. Figure 3 A processing flow chart of a data processing method applied in an actual scenario provided by an embodiment of the present application is shown, which specifically includes the following steps:

[0138] Step 302: Receive initial data carrying protocol information.

[0139] Step 304: Determine the initial protocol item description information and the second historical protocol item description information corresponding to the protocol information.

[0140] Step 306: Perform data conversion on the initial sub-data in the initial data according to the initial protocol item description information and the second historical protocol item description information to obtain and store historical data.

[0141] Step 308: Receive a data processing instruction submitted by a user.

[0142] Step 310: Acquire historical data carrying protocol information according to the data identification information carried in the data processing instruction.

[0143] Step 312: Determine the target protocol item description information and the historical protocol item description information corresponding to the protocol information.

[0144] Step 314: Determine the information arrangement order according to the target protocol item sequence number in the target protocol item description information and the historical protocol item sequence number in the historical protocol item description information.

[0145] Step 316: The first protocol item description information in the target protocol item description information and the second protocol item description information in the historical protocol item description information are sequentially processed on the historical sub-data in the historical data according to the information arrangement order to obtain the target data.

[0146] The data processing method provided in the embodiment of the present application obtains historical data carrying protocol information; determines the target protocol item description information and the historical protocol item description information corresponding to the protocol information; processes the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain the target data, thereby realizing the processing of historical data through the protocol item description information and avoiding the processing of historical data through the historical version of the data protocol. Therefore, there is no need to store the historical version of the data protocol, thereby reducing the storage space occupied by the historical data protocol.

[0147] Corresponding to the above method embodiment, the present application also provides a data processing device embodiment, Figure 4 FIG. 1 is a schematic diagram showing the structure of a data processing device provided by an embodiment of the present application. Figure 4 As shown, the device comprises:

[0148] An acquisition module 402 is configured to acquire historical data carrying protocol information;

[0149] A determination module 404 is configured to determine target protocol item description information and historical protocol item description information corresponding to the protocol information;

[0150] The processing module 406 is configured to process the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain target data.

[0151] Optionally, the data processing device further includes:

[0152] A receiving module, configured to receive initial data carrying the protocol information;

[0153] A second determining module is configured to determine initial protocol item description information and second historical protocol item description information corresponding to the protocol information;

[0154] The conversion module is configured to perform data conversion on the initial sub-data in the initial data according to the initial protocol item description information and the second historical protocol item description information, obtain the historical data and store it.

[0155] Optionally, the processing module 406 is further configured to:

[0156] Determine the information arrangement order according to the target protocol item sequence number in the target protocol item description information and the historical protocol item sequence number in the historical protocol item description information;

[0157] The first protocol item description information in the target protocol item description information and the second protocol item description information in the historical protocol item description information are sequentially processed on the historical sub-data in the historical data according to the information arrangement order to obtain the target data.

[0158] Optionally, the processing module 406 is further configured to:

[0159] In the case that any descriptive sub-information in the first protocol item description information does not have corresponding historical sub-data in the historical data, taking the any descriptive sub-information that does not have corresponding historical sub-data in the historical data as the first descriptive sub-information, and creating target sub-data according to the first descriptive sub-information;

[0160] In the case that any descriptive sub-information in the first protocol item description information has corresponding first historical sub-data in the historical data, any descriptive sub-information that has corresponding first historical sub-data in the historical data is used as second descriptive sub-information, and the first historical sub-data is processed according to the second descriptive sub-information to obtain target sub-data.

[0161] Optionally, the processing module 406 is further configured to:

[0162] Determine a target data type corresponding to the first data type of the first historical sub-data in the second descriptor information;

[0163] Determine a target variable name corresponding to the target data type in the second descriptor information;

[0164] Using the data value corresponding to the first data type as the target data value corresponding to the target variable name;

[0165] The target sub-data is generated according to the target data type, the target variable name and the target data value.

[0166] Optionally, the processing module 406 is further configured to:

[0167] Determine the target data quantity corresponding to the target variable name in the second descriptor information;

[0168] determining a target data value of the target data quantity based on a data value of a first data quantity corresponding to the first data type;

[0169] The target sub-data is generated according to the target data type, the target variable name, the target data quantity and the target data value.

[0170] Optionally, the processing module 406 is further configured to:

[0171] Determine the target data type in the first descriptor information and determine the target variable name and preset value corresponding to the target data type, and use the preset value as the target data value;

[0172] The target sub-data is generated according to the target data type, the target variable name and the target data value.

[0173] Optionally, the processing module 406 is further configured to:

[0174] In the case where the second protocol item description information has corresponding second historical sub-data in the historical data, the second historical sub-data is deleted from the historical sub-data.

[0175] Optionally, the conversion module is further configured to:

[0176] Determining the arrangement order of the second information according to the initial protocol item sequence number in the initial protocol item description information and the second historical protocol item sequence number in the second historical protocol item description information;

[0177] The third protocol item description information in the initial protocol item description information and the fourth protocol item description information in the second historical protocol item description information are sequentially converted into the initial sub-data in the initial data according to the arrangement order of the second information to obtain and store the historical data.

[0178] The data processing device provided in the embodiment of the present application obtains historical data carrying protocol information; determines the target protocol item description information and the historical protocol item description information corresponding to the protocol information; processes the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain the target data, thereby realizing the processing of historical data through the protocol item description information and avoiding the processing of historical data through the historical version of the data protocol. Therefore, there is no need to store the historical version of the data protocol, thereby reducing the storage space occupied by the historical data protocol.

[0179] The above is a schematic scheme of a data processing device of this embodiment. It should be noted that the technical scheme of the data processing device and the technical scheme of the above data processing method belong to the same concept, and the details of the technical scheme of the data processing device that are not described in detail can be referred to the description of the technical scheme of the above data processing method.

[0180] In one embodiment of the present application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the data processing method when executing the computer instructions.

[0181] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data processing method.

[0182] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which implement the steps of the data processing method as described above when executed by a processor.

[0183] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above data processing method.

[0184] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0185] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0186] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0187] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0188] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A data processing method, characterized in that: include: Obtain historical data carrying protocol information; Determine target protocol item description information and historical protocol item description information corresponding to the protocol information, wherein the target protocol item is a protocol item included in a current data protocol corresponding to the protocol information, and the historical protocol item is a protocol item other than the target protocol item included in a historical data protocol corresponding to the protocol information; Processing the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain target data, wherein the target data is data that complies with the current data protocol; The step of processing the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain the target data includes: The historical sub-data in the historical data are converted according to the target protocol item description information and the historical protocol item description information to obtain the target data, wherein the historical sub-data is the protocol data item in the historical data.

2. The data processing method according to claim 1, characterized in that: Before acquiring the historical data carrying the protocol information, the method further includes: Receiving initial data carrying the protocol information; Determine initial protocol item description information and second historical protocol item description information corresponding to the protocol information, wherein the initial protocol item is a protocol item in a data protocol corresponding to the protocol information carried by the initial data when the initial data is received, and the second historical protocol item is a protocol item other than the initial protocol item in a historical data protocol before the initial data protocol when the initial data is received; The initial sub-data in the initial data is converted according to the initial protocol item description information and the second historical protocol item description information to obtain and store the historical data.

3. The data processing method according to claim 1, characterized in that: The processing of the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain the target data includes: Determine the information arrangement order according to the target protocol item sequence number in the target protocol item description information and the historical protocol item sequence number in the historical protocol item description information; The first protocol item description information in the target protocol item description information and the second protocol item description information in the historical protocol item description information are sequentially processed on the historical sub-data in the historical data according to the information arrangement order to obtain the target data.

4. The data processing method according to claim 3, characterized in that: The historical sub-data in the historical data is processed by using the first protocol item description information, which is specifically implemented in the following manner: In the case that any descriptive sub-information in the first protocol item description information does not have corresponding historical sub-data in the historical data, taking the any descriptive sub-information that does not have corresponding historical sub-data in the historical data as the first descriptive sub-information, and creating target sub-data according to the first descriptive sub-information; In the case that any descriptive sub-information in the first protocol item description information has corresponding first historical sub-data in the historical data, any descriptive sub-information that has corresponding first historical sub-data in the historical data is used as second descriptive sub-information, and the first historical sub-data is processed according to the second descriptive sub-information to obtain target sub-data.

5. The data processing method according to claim 4, characterized in that: The step of processing the first historical sub-data according to the second descriptor information to obtain target sub-data includes: Determine a target data type corresponding to the first data type of the first historical sub-data in the second descriptor information; Determine a target variable name corresponding to the target data type in the second descriptor information; Using the data value corresponding to the first data type as the target data value corresponding to the target variable name; The target sub-data is generated according to the target data type, the target variable name and the target data value.

6. The data processing method according to claim 5, characterized in that: The step of determining the target data type after the target variable name corresponding to the second descriptor information includes: Determine the target data quantity corresponding to the target variable name in the second descriptor information; determining a target data value of the target data quantity based on a data value of a first data quantity corresponding to the first data type; The target sub-data is generated according to the target data type, the target variable name, the target data quantity and the target data value.

7. The data processing method according to claim 4, characterized in that: Creating target sub-data according to the first descriptor information includes: Determine the target data type in the first descriptor information and determine the target variable name and preset value corresponding to the target data type, and use the preset value as the target data value; The target sub-data is generated according to the target data type, the target variable name and the target data value.

8. The data processing method according to claim 3, characterized in that: The historical sub-data in the historical data is processed by using the second protocol item description information, which is specifically implemented in the following manner: In the case where the second protocol item description information has corresponding second historical sub-data in the historical data, the second historical sub-data is deleted from the historical sub-data.

9. The data processing method according to claim 2, characterized in that: The performing data conversion on the initial sub-data in the initial data according to the initial protocol item description information and the second historical protocol item description information to obtain and store the historical data includes: Determining the arrangement order of the second information according to the initial protocol item sequence number in the initial protocol item description information and the second historical protocol item sequence number in the second historical protocol item description information; The third protocol item description information in the initial protocol item description information and the fourth protocol item description information in the second historical protocol item description information are sequentially converted into the initial sub-data in the initial data according to the arrangement order of the second information to obtain and store the historical data.

10. A data processing device, characterized in that: include: An acquisition module, configured to acquire historical data carrying protocol information; a determination module configured to determine target protocol item description information and historical protocol item description information corresponding to the protocol information, wherein the target protocol item is a protocol item included in a current data protocol corresponding to the protocol information, and the historical protocol item is a protocol item other than the target protocol item included in a historical data protocol corresponding to the protocol information; a processing module, configured to process the historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain target data, wherein the target data is data that complies with the current data protocol; The processing module is further configured to convert historical sub-data in the historical data according to the target protocol item description information and the historical protocol item description information to obtain target data, wherein the historical sub-data is the protocol data item in the historical data.

11. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer instructions, the steps of the method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Protocol text generation method, device and equipment

    CN113850066A

  • Dynamic item management system for decive with multi-version protocal using SRS and method thereof

    KR101390892B1