Encoding method, apparatus, computer device and storage medium
By generating the encoding range of rational number intervals using the Möbius transform function and the encoding type selection function, the problem of limited node capacity in the component tree in traditional technology is solved, and the infinite expansion and independence of node encoding are realized.
Patent Information
- Application Number
- CN202310299035.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In traditional technologies, the node encoding method for nuclear power equipment component trees uses integer encoding, which limits the number of child nodes that each node can accommodate, thus restricting the construction of the component tree.
The node index is encoded using the Möbius transform function. By adjusting the interval endpoint values of the parent node and the encoding type selection function, the encoding interval of rational number interval is generated to ensure that each node can accommodate an infinite number of child nodes.
It enables unlimited expansion of the component tree node capacity, avoids the problem of variable node encoding, and ensures the independence and flexibility of node encoding.
Smart Images

Figure CN116301899B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an encoding method, apparatus, computer equipment, and storage medium. Background Technology
[0002] The component tree of nuclear power equipment is a tree-like structure that describes the constituent components of large nuclear power equipment and their hierarchical relationships. The root node is generally composed of the large equipment body. By deconstructing and decomposing the equipment body layer by layer, the component tree of the entire equipment is formed. This is a typical infinite hierarchical tree structure. There are generally two tree structure models to handle this infinite hierarchical nonlinear relationship: the hierarchical recursive model and the tree coding model.
[0003] Among them, the tree coding model encodes and indexes tree nodes through algorithms, which shortens the node query time and reduces the query complexity. For example, an improved preorder traversal tree model encodes a tree node using only a pair of ordered positive integers called left and right values. The ancestor-descendant relationship is reflected through the subset relationship between integer intervals, providing a very intuitive basis for hierarchical queries.
[0004] However, traditional techniques use integers to encode the left and right values of nodes, which limits the number of child nodes that each node can accommodate, making it unfavorable for building component trees. Summary of the Invention
[0005] Therefore, it is necessary to provide an encoding method, apparatus, computer device, and storage medium that facilitates the construction of component trees to address the aforementioned technical problems.
[0006] Firstly, this application provides an encoding method, which includes:
[0007] Get the node index corresponding to the child node to be encoded;
[0008] The node index is determined as the variable value of the Möbius transform function;
[0009] Based on the coefficients of the Möbius transform function and the variable values corresponding to the node indices, the encoding interval corresponding to the child node to be encoded is obtained; where the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0010] In one embodiment, adjusting the endpoint value of the parent interval corresponding to the parent node of the child node to be encoded includes:
[0011] Based on the scaling factor, the values of the parent interval endpoints corresponding to the parent node of the child node to be encoded are adjusted to obtain the coefficients of the Möbius transform function.
[0012] In one embodiment, the node index is determined as the variable value of the Möbius transform function, including:
[0013] Based on the encoding type selection function, the node index is transformed to obtain the transformed index; where the encoding type selection function is a monotonic function of the node index within the parent interval;
[0014] The transformation index is determined as the variable value of the Möbius transform function.
[0015] In one embodiment, the encoding type selection function is a linear function or an exponential function.
[0016] In one embodiment, the node index includes a left sub-index and a right sub-index; based on the coefficients of the Möbius transform function and the variable values corresponding to the node index, the encoding interval corresponding to the child node to be encoded is obtained, including:
[0017] The left-coded value is determined based on the left sub-index and the coefficients of the Möbius transform function;
[0018] The right-coded value is determined based on the right sub-index and the coefficients of the Möbius transform function;
[0019] Based on the left and right encoded values, the encoding interval corresponding to the child node to be encoded is determined.
[0020] In one embodiment, the method further includes: for any coding interval, determining a mapping relationship between the coding interval and its corresponding parent interval, and storing the mapping relationship;
[0021] The mapping relationship is used to determine the parent interval corresponding to the encoding interval when the query instruction corresponding to the parent interval is obtained.
[0022] Secondly, this application also provides an encoding device, which includes:
[0023] The acquisition module is used to obtain the node index corresponding to the child node to be encoded;
[0024] The assignment module is used to determine the node index as the variable value of the Möbius transform function;
[0025] The determination module is used to obtain the encoding interval corresponding to the child node to be encoded based on the coefficients of the Möbius transform function and the variable values corresponding to the node index; wherein, the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0026] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0027] Get the node index corresponding to the child node to be encoded;
[0028] The node index is determined as the variable value of the Möbius transform function;
[0029] Based on the coefficients of the Möbius transform function and the variable values corresponding to the node indices, the encoding interval corresponding to the child node to be encoded is obtained; where the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0030] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0031] Get the node index corresponding to the child node to be encoded;
[0032] The node index is determined as the variable value of the Möbius transform function;
[0033] Based on the coefficients of the Möbius transform function and the variable values corresponding to the node indices, the encoding interval corresponding to the child node to be encoded is obtained; where the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0034] Fifthly, this application also provides a computer program product comprising a computer program that, when executed by a processor, performs the following steps:
[0035] Get the node index corresponding to the child node to be encoded;
[0036] The node index is determined as the variable value of the Möbius transform function;
[0037] Based on the coefficients of the Möbius transform function and the variable values corresponding to the node indices, the encoding interval corresponding to the child node to be encoded is obtained; where the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0038] The aforementioned encoding method, apparatus, computer equipment, and storage medium, after knowing the encoding interval of the parent node, obtain the coefficients of the Möbius transform function based on the encoding interval of the parent node, i.e., the encoding interval of the parent node is a rational number interval; for any child node to be encoded under the parent node, the node index corresponding to the child node to be encoded is determined as the variable value of the Möbius transform function, substituted into the Möbius transform function, and the function value of the Möbius transform function is calculated. This function value is used as the encoding interval of the child node to be encoded, thus ensuring that the encoding interval of the child node to be encoded falls within the encoding interval of the parent node, generating encoding intervals with hierarchical relationships corresponding to the parent and child nodes, and each different child node to be encoded corresponds to... The different node indices ensure that the encoding intervals of each different child node to be encoded are independent of each other, eliminating the need to modify the encoding intervals of other child nodes to be encoded and avoiding the problem of volatile node encoding. In addition, the encoding interval of the child node to be encoded, generated based on the Möbius transform function, is a rational number interval. Therefore, since the number of rational numbers in the rational number interval is infinite, the capacity of the nodes in this rational number interval is guaranteed to be infinite. That is, an infinite number of child nodes can be inserted into this rational number interval. Correspondingly, an infinite number of encoding intervals for the next level node can also be generated in the encoding interval of the child node to be encoded. Compared with traditional technology, this solves the problem of limited node capacity in the component tree. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating the encoding method in one embodiment;
[0040] Figure 2 This is a flowchart illustrating the process of determining the encoding range of a child node to be encoded in one embodiment;
[0041] Figure 3 This is a flowchart illustrating the process of determining variable values based on an encoding type selection function in one embodiment;
[0042] Figure 4 This is a flowchart illustrating the encoding method in another embodiment;
[0043] Figure 5 This is a structural block diagram of the encoding device in one embodiment;
[0044] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] The encoding method provided in this application is applicable to data processing scenarios, specifically to component tree construction scenarios. Optionally, this method can be executed by a computer device, which may be a server.
[0047] In one embodiment, such as Figure 1 As shown, an encoding method is provided, which includes the following steps:
[0048] S101, obtain the node index corresponding to the child node to be encoded.
[0049] In the component tree of nuclear power equipment, each node represents a device or a corresponding component. Node types can include root nodes and child nodes, with child nodes being the components that make up the root node (device). It is understood that in the component tree of nuclear power equipment, the node index of each node refers to the unique identifier of that node, such as an ID; for example, the node index corresponding to the first node is 1 (or A), the node index corresponding to the second node is 2 (or B), the node index corresponding to the third node is 3 (or C), and so on.
[0050] Furthermore, to characterize the hierarchical relationships between nodes and facilitate the addition and deletion of nodes, each node in the component tree in this embodiment is configured with two attributes: node index and encoding range. As shown in the example above, when there is a parent-child relationship between two nodes, then there is a nested relationship between the encoding ranges of these two nodes. Therefore, the component tree can be generated based on the nested relationship of the encoding ranges between the nodes. In this case, the child node to be encoded refers to the node in the component tree whose encoding range is to be generated.
[0051] S102, determine the node index as the variable value of the Möbius transform function.
[0052] The Möbius transform function is given by equation (1):
[0053]
[0054] Where a, b, c, and d are the coefficients of the Möbius transform function, and x is the variable value of the Möbius transform function.
[0055] S103, based on the coefficients of the Möbius transform function and the variable values corresponding to the node index, obtain the encoding interval corresponding to the child node to be encoded.
[0056] Furthermore, when bc-ad > 0 and x ∈ [1, +∞], the Möbius transform function The range of values is shown in equation (2) below:
[0057]
[0058] The coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0059] In formula (2), assume a, c, a+b, c+d>0, and let a = lft_num , c=lft_den, a+b=rgt_num, c+d=rgt_den;
[0060] Where lft_num and lft_den represent the numerator and denominator of the left boundary of the coding interval corresponding to the parent node; rgt_num and rgt_den represent the numerator and denominator of the right boundary of the coding interval. Substituting into the above formula (3) and transforming it, we can obtain the following formula:
[0061]
[0062] Based on formula (3), it can be seen that once the encoding interval corresponding to the parent node to which the child node to be encoded belongs is determined... Then, the coefficients a, b, c and d in the Möbius transform function can be determined; then the node index (x) of the child node to be encoded can be determined, and the node index (x) can be substituted into the corresponding f(x) in the above formula (3). The value of f(x) can be used as the encoding value of the node index (x).
[0063] It is understandable that, in order to generate the encoding range of the node index, in one possible implementation, the node index of each child node to be encoded can be a node index range, such as [x1, x2]. In this case, based on the above formula (3), the encoding range corresponding to the node index can be obtained. In another possible implementation, the node index of each child node to be encoded can be a single value, such as x. In this case, based on the above formula (3), the encoding value corresponding to the node index can be obtained, and the encoding value can be further transformed to generate the encoding range.
[0064] In the above encoding method, after knowing the encoding interval of the parent node, the coefficients of the Möbius transform function are obtained based on the encoding interval of the parent node, that is, the encoding interval of the parent node is a rational number interval. For any child node to be encoded under the parent node, the node index corresponding to the child node to be encoded is determined as the variable value of the Möbius transform function. Substituting it into the Möbius transform function, the function value of the Möbius transform function is calculated. This function value is used as the encoding interval of the child node to be encoded, so that the encoding interval of the child node to be encoded falls within the encoding interval of the parent node, generating encoding intervals with hierarchical relationships corresponding to the parent and child nodes, and the node indices corresponding to different child nodes to be encoded are not... This design ensures that the encoding intervals of different child nodes to be encoded are independent of each other, eliminating the need to modify the encoding intervals of other child nodes and avoiding the problem of volatile node encoding. In addition, the encoding interval of the child nodes to be encoded, generated based on the Möbius transform function, is a rational number interval. Therefore, since the number of rational numbers in the rational number interval is infinite, the capacity of the nodes in this rational number interval is guaranteed to be infinite. That is, an infinite number of child nodes can be inserted into this rational number interval. Correspondingly, an infinite number of encoding intervals for the next level node can be generated again within the encoding interval of the child node to be encoded. Compared with traditional techniques, this solves the problem of limited node capacity in the component tree.
[0065] like Figure 2 As shown, this embodiment provides an optional method for obtaining the encoding interval corresponding to the child node to be encoded based on the coefficients of the Möbius transform function and the variable values corresponding to the node index, that is, a method for refining S103. The node index includes a left sub-index and a right sub-index; optionally, in this embodiment, both the left and right sub-indexes are natural numbers.
[0066] S201, determine the left-coded value based on the left sub-index and the coefficients of the Möbius transform function.
[0067] Specifically, for any child node of the parent node, if the node index corresponding to the child node is x1 and x2 (and x2 > x1), x1 is used as the variable value of the Möbius transform function. Substituting it into the Möbius transform function, the left encoded value f(x1) is obtained.
[0068] S202, determine the right-coded value based on the right sub-index and the coefficients of the Möbius transform function.
[0069] Furthermore, by substituting x2 as a variable value into the Möbius transform function, we obtain the left-coded value f(x2).
[0070] S203, based on the left and right encoding values, determine the encoding interval corresponding to the child node to be encoded.
[0071] As shown in the example above, it can be seen from formula (3) that f(x1) and f(x2) are located in the encoding interval. Given two rational numbers within the parent node, using [f(x1), f(x2)] as the encoding interval for this child node allows the encoding interval of the child node to be nested within the encoding interval of the parent node. Within, to construct the encoding range of parent-child nodes with hierarchical relationships.
[0072] Furthermore, for different child nodes to be encoded, by setting different node indices, the encoding ranges of multiple independent child nodes can be obtained; for example, the first child node corresponds to node indices x1 and x2, the second child node corresponds to node indices x2 and x3, the third child node corresponds to node indices x3 and x4, and so on.
[0073] In one embodiment, this embodiment provides an optional method for adjusting the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded, that is, a method for refining S203. The specific implementation process may include: adjusting the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded based on a scaling factor to obtain the coefficients of the Möbius transform function.
[0074] Wherein, when the value of the endpoint of the parent interval corresponding to the parent node is... When the fraction is not an irreducible fraction, the interval scaling factor can be extracted to adjust the values of the parent interval endpoints corresponding to the parent node. Assuming that the interval scaling factors of the left and right values are λ and μ respectively, substituting the scaling factor into the above formula (3) will yield the following formula - formula (4):
[0075]
[0076] In this case, f(x) is called a nested interval generator, and f(x; λ, μ) is called a nested interval generator with a scaling factor; correspondingly, the Möbius mapping functions a, b, c, and d are as follows:
[0077] a = λ * lft_num;
[0078] b = μ*rgt_num - μ*lft_num;
[0079] c = λ * lft_den;
[0080] d = μ*rgt_num - λ*lft_den.
[0081] In this embodiment, by setting a scaling factor, the initial values of the parent interval endpoints can be adjusted to construct a new Möbius mapping function, thereby generating different encoding intervals for the child nodes to be encoded, and achieving flexible division of the encoding interval.
[0082] Furthermore, in order to further improve the diversity of the encoding intervals for generating child nodes to be encoded, such as... Figure 3 As shown, this embodiment provides an optional way to determine the node index as the variable value of the Möbius transform function, that is, to provide a way to refine S203.
[0083] S301, based on the encoding type selection function, transforms the node index to obtain the transformed index.
[0084] Among them, the encoding type selection function is a monotonic function g(x) of the node index in the parent interval, and g(x) satisfies the following conditions: (1) g(0) = 1 or g(1) = 1, and (2) When x∈[1,+∞], g(x) is monotonic.
[0085] Optionally, the encoding type selection function can be either a linear function or an exponential function.
[0086] S302, determine the transformation index as the variable value of the Möbius transformation function.
[0087] As in the example above, substituting x1 into g(x) yields the transformation index g(x1), and substituting x2 into g(x) yields the transformation index g(x2). g(x1) and g(x2) are then determined as the variable values of the Möbius transformation function.
[0088] Specifically, by introducing g(x) based on formula (4), a new composite nested interval generator M(x; λ, μ) can be obtained, as shown in the following formula (5):
[0089]
[0090] In this case, M(x1, λ, μ) and M(x2, λ, μ) are determined as the encoding intervals of the child nodes to be encoded.
[0091] In this embodiment, by introducing the encoding type selection function g(x), the node index of the node to be encoded can be transformed to obtain the transformed index. Then, the transformed index is substituted into the Möbius mapping function to obtain different encoding intervals, making the generation of encoding intervals diverse.
[0092] In one embodiment, the encoding method further includes: for any encoding interval, determining the mapping relationship between the encoding interval and the parent interval corresponding to the encoding interval, and storing the mapping relationship.
[0093] The mapping relationship is used to determine the parent interval corresponding to the encoding interval when the query instruction corresponding to the parent interval is obtained.
[0094] Specifically, when querying child nodes, a partial order query can be used; when querying parent nodes, the parent node code can be obtained using the following method:
[0095] For example, let the coding interval of any coding interval be... Where lftNum represents the left-hand numerator, lftDen represents the left-hand denominator, rgtNum represents the right-hand numerator, rgtDen represents the right-hand denominator, and index represents the node index of any child node, then the parent interval (upper level) corresponding to this coding interval is:
[0096] Specifically, the mapping relationship between this encoding interval and its corresponding parent interval is as follows:
[0097] resNum=lftNum-rgtNum
[0098] resDen=lftDen-rgtDen
[0099] a=resDen / (g(index)-g(index-1))
[0100] b = lftDen - a * g(index)
[0101] c=resNum / (g(index-g(index-1)))
[0102] d = leftNum - c * g(index)
[0103] For example, based on the above embodiments, this embodiment provides an optional example of an encoding method, the specific implementation process of which includes:
[0104] Step 1: Set the range scaling factors λ and μ for the device tree encoding. To ensure that the encoding of the obtained device tree nodes is a reduced fraction, they are generally set to λ = 1 and μ = 1.
[0105] Step 2: Select the nuclear power equipment itself as the parent node and set its nested range encoding. In the nuclear power equipment configuration tree structure, lft_num = 0, lft_den = 1, rgt_num = 1, rgt_den = 1, that is, the starting interval is set to...
[0106] Step 3: Set a compliant encoding type selector g(x), for example, g(x) = x;
[0107] Step 4: Based on the parameters from Step 1 to Step 3, obtain the composite nested interval generator M(x, λ, μ) with scaling factor;
[0108] Step 5: Substitute the node index i of the child node to be encoded into the compound nested interval generator to generate the nested interval encoding M(i+1, λ, μ) and M(i, λ, μ) of the child node;
[0109] Step 6: Encode the nested interval M(i+1, λ, μ) of the child node to be encoded, with M(i, λ, μ) as the starting interval, and repeat steps one to five above to generate the nested interval encoding of the grandchild node.
[0110] like Figure 4 The diagram illustrates a device tree encoding based on a nested interval model. The nested interval encoding of the device body is as follows: The range scaling factors λ and μ for device tree encoding are both set to 1. Using steps one through six above, the entire device tree can be encoded.
[0111] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0112] Based on the same inventive concept, this application also provides an encoding apparatus for implementing the encoding method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more encoding apparatus embodiments provided below can be found in the limitations of the encoding method described above, and will not be repeated here.
[0113] In one embodiment, such as Figure 5 As shown, an encoding device 1 is provided, comprising: an acquisition module 11, an assignment module 12, and a determination module 13, wherein:
[0114] Module 11 is used to obtain the node index corresponding to the child node to be encoded;
[0115] Assignment module 12 is used to determine the node index as the variable value of the Möbius transform function;
[0116] The determination module 13 is used to obtain the encoding interval corresponding to the child node to be encoded based on the coefficients of the Möbius transform function and the variable values corresponding to the node index; wherein, the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0117] In one embodiment, the determining module 13 is further configured to: adjust the values of the parent interval endpoints corresponding to the parent node of the child node to be encoded based on the scaling factor, so as to obtain the coefficients of the Möbius transform function.
[0118] In one embodiment, the assignment module 12 is further configured to: transform the node index based on the encoding type selection function to obtain the transformed index; wherein the encoding type selection function is a monotonic function of the node index within the parent interval;
[0119] The transformation index is determined as the variable value of the Möbius transform function.
[0120] In one embodiment, the encoding type selection function is either a linear function or an exponential function.
[0121] In one embodiment, the node index includes a left sub-index and a right sub-index; the determining module 13 is further configured to: determine the left encoded value based on the left sub-index and the coefficients of the Möbius transform function;
[0122] The right-coded value is determined based on the right sub-index and the coefficients of the Möbius transform function;
[0123] Based on the left and right encoded values, the encoding interval corresponding to the child node to be encoded is determined.
[0124] In one embodiment, the encoding device further includes a query module, which is configured to: for any encoding interval, determine the mapping relationship between the encoding interval and the corresponding parent interval, and store the mapping relationship; wherein the mapping relationship is used to determine the corresponding parent interval of the encoding interval based on the determination of the encoding interval when a query instruction corresponding to the parent interval is obtained.
[0125] Each module in the aforementioned encoding device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0126] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to encoding methods. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an encoding method.
[0127] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0128] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0129] Get the node index corresponding to the child node to be encoded;
[0130] The node index is determined as the variable value of the Möbius transform function;
[0131] Based on the coefficients of the Möbius transform function and the variable values corresponding to the node indices, the encoding interval corresponding to the child node to be encoded is obtained; where the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0132] In one embodiment, when the processor executes the logic of adjusting the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded, the specific steps are as follows: based on the scaling factor, the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded are adjusted to obtain the coefficients of the Möbius transform function.
[0133] In one embodiment, when the processor executes the logic of the computer program to determine the variable value of the node index as the variable value of the Möbius transform function, the following steps are specifically implemented: transforming the node index based on the encoding type selection function to obtain the transform index; wherein, the encoding type selection function is a monotonic function of the node index in the parent interval; and determining the transform index as the variable value of the Möbius transform function.
[0134] In one embodiment, the encoding type selection function is either a linear function or an exponential function.
[0135] In one embodiment, the node index includes a left sub-index and a right sub-index. When the processor executes the logic of the computer program to obtain the encoding interval corresponding to the child node to be encoded based on the coefficients of the Möbius transform function and the variable values corresponding to the node index, the specific steps are as follows: determine the left encoding value based on the left sub-index and the coefficients of the Möbius transform function; determine the right encoding value based on the right sub-index and the coefficients of the Möbius transform function; and determine the encoding interval corresponding to the child node to be encoded based on the left encoding value and the right encoding value.
[0136] In one embodiment, when the processor executes the computer program, it further implements the following steps: for any encoding interval, determining the mapping relationship between the encoding interval and the parent interval corresponding to the encoding interval, and storing the mapping relationship; wherein, the mapping relationship is used to determine the parent interval corresponding to the encoding interval based on the determination of the encoding interval when a query instruction corresponding to the parent interval is obtained.
[0137] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0138] Get the node index corresponding to the child node to be encoded;
[0139] The node index is determined as the variable value of the Möbius transform function;
[0140] Based on the coefficients of the Möbius transform function and the variable values corresponding to the node indices, the encoding interval corresponding to the child node to be encoded is obtained; where the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0141] In one embodiment, when the logic of adjusting the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded is executed by the processor, the following steps are specifically implemented: based on the scaling factor, the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded are adjusted to obtain the coefficients of the Möbius transform function.
[0142] In one embodiment, when the logic of determining the node index as the variable value of the Möbius transform function is executed by the processor, the following steps are specifically implemented: transforming the node index based on the encoding type selection function to obtain the transform index; wherein, the encoding type selection function is a monotonic function of the node index in the parent interval; and determining the transform index as the variable value of the Möbius transform function.
[0143] In one embodiment, the encoding type selection function is either a linear function or an exponential function.
[0144] In one embodiment, the node index includes a left sub-index and a right sub-index. When the logic of the computer program obtaining the encoding interval corresponding to the child node to be encoded based on the coefficients of the Möbius transform function and the variable values corresponding to the node index is executed by the processor, the specific steps are as follows: determining the left encoding value based on the left sub-index and the coefficients of the Möbius transform function; determining the right encoding value based on the right sub-index and the coefficients of the Möbius transform function; and determining the encoding interval corresponding to the child node to be encoded based on the left encoding value and the right encoding value.
[0145] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: for any encoding interval, determining the mapping relationship between the encoding interval and the parent interval corresponding to the encoding interval, and storing the mapping relationship; wherein, the mapping relationship is used to determine the parent interval corresponding to the encoding interval based on the determination of the encoding interval when a query instruction corresponding to the parent interval is obtained.
[0146] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0147] Get the node index corresponding to the child node to be encoded;
[0148] The node index is determined as the variable value of the Möbius transform function;
[0149] Based on the coefficients of the Möbius transform function and the variable values corresponding to the node indices, the encoding interval corresponding to the child node to be encoded is obtained; where the coefficients of the Möbius transform function are obtained by adjusting the values of the endpoints of the parent interval corresponding to the parent node of the child node to be encoded.
[0150] In one embodiment, when the logic of adjusting the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded is executed by the processor, the following steps are specifically implemented: based on the scaling factor, the endpoint values of the parent interval corresponding to the parent node of the child node to be encoded are adjusted to obtain the coefficients of the Möbius transform function.
[0151] In one embodiment, when the logic of determining the node index as the variable value of the Möbius transform function is executed by the processor, the following steps are specifically implemented: transforming the node index based on the encoding type selection function to obtain the transform index; wherein, the encoding type selection function is a monotonic function of the node index in the parent interval; and determining the transform index as the variable value of the Möbius transform function.
[0152] In one embodiment, the encoding type selection function is either a linear function or an exponential function.
[0153] In one embodiment, the node index includes a left sub-index and a right sub-index. When the logic of the computer program obtaining the encoding interval corresponding to the child node to be encoded based on the coefficients of the Möbius transform function and the variable values corresponding to the node index is executed by the processor, the specific steps are as follows: determining the left encoding value based on the left sub-index and the coefficients of the Möbius transform function; determining the right encoding value based on the right sub-index and the coefficients of the Möbius transform function; and determining the encoding interval corresponding to the child node to be encoded based on the left encoding value and the right encoding value.
[0154] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: for any encoding interval, determining the mapping relationship between the encoding interval and the parent interval corresponding to the encoding interval, and storing the mapping relationship; wherein, the mapping relationship is used to determine the parent interval corresponding to the encoding interval based on the determination of the encoding interval when a query instruction corresponding to the parent interval is obtained.
[0155] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0156] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0157] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An encoding method characterized by comprising: The method comprises: obtaining a node index corresponding to a to-be-encoded child node; wherein the node index comprises a left child index and a right child index; transforming the node index based on an encoding type selection function to obtain a transformed index; wherein the encoding type selection function is a linear function or an exponential function; and the transformed index comprises a transformed index corresponding to the left child index and a transformed index corresponding to the right child index; determining the transformed index corresponding to the left child index as a variable value of a Möbius transformation function corresponding to the left child index, and determining the transformed index corresponding to the right child index as a variable value of the Möbius transformation function corresponding to the right child index; determining a left encoding value based on the variable value of the Möbius transformation function corresponding to the left child index and a coefficient of the Möbius transformation function; wherein the coefficient of the Möbius transformation function is obtained by adjusting a parent interval endpoint numerical value corresponding to a parent node of the to-be-encoded child node based on a scaling factor; determining a right encoding value based on the variable value of the Möbius transformation function corresponding to the right child index and the coefficient of the Möbius transformation function; determining an encoding interval corresponding to the to-be-encoded child node based on the left encoding value and the right encoding value.
2. The method of claim 1, wherein, The to-be-encoded child node is a node for which an encoding interval is to be generated in a component tree of a nuclear power equipment. Each node in the component tree represents a device or a component corresponding to a device.
3. The method of claim 1, wherein, The scaling factor comprises a left value scaling factor and a right value scaling factor; and the parent interval endpoint numerical value comprises a left endpoint value and a right endpoint value. The adjusting the parent interval endpoint numerical value corresponding to the parent node of the to-be-encoded child node based on the scaling factor comprises: adjusting the left endpoint value based on the left value scaling factor; and adjusting the right endpoint value based on the right value scaling factor.
4. The method of claim 1, wherein, The method further comprises: determining a mapping relationship between any encoding interval and a parent interval corresponding to the encoding interval, and storing the mapping relationship; wherein the mapping relationship is used to determine the parent interval corresponding to the encoding interval when a query instruction corresponding to the parent interval is obtained.
5. An encoding apparatus characterized by comprising: The apparatus comprises: an obtaining module configured to obtain a node index corresponding to a to-be-encoded child node; wherein the node index comprises a left child index and a right child index; an assigning module configured to transform the node index based on an encoding type selection function to obtain a transformed index; wherein the encoding type selection function is a linear function or an exponential function; and the transformed index comprises a transformed index corresponding to the left child index and a transformed index corresponding to the right child index; determining the transformed index corresponding to the left child index as a variable value of a Möbius transformation function corresponding to the left child index, and determining the transformed index corresponding to the right child index as a variable value of the Möbius transformation function corresponding to the right child index; determining a left encoding value based on a variable value of a Möbius transform function corresponding to the left child index and a coefficient of the Möbius transform function, wherein the coefficient of the Möbius transform function is obtained by adjusting parent interval endpoint values corresponding to a parent node of the to-be-encoded child node based on a scaling factor; determining a right encoding value based on the variable value of the Möbius transform function corresponding to the right child index and the coefficient of the Möbius transform function; determining an encoding interval corresponding to the to-be-encoded child node based on the left encoding value and the right encoding value. 6.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-5 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 4.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
Citation Information
Patent Citations
GIS (Geographic Information System) vector data hierarchical coding method and device based on tree-shaped hierarchical index
CN115145930A
KR20190015455A